!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("rb_wixui.thunderbolt[TextAreaInput]",["react"],t):"object"==typeof exports?exports["rb_wixui.thunderbolt[TextAreaInput]"]=t(require("react")):e["rb_wixui.thunderbolt[TextAreaInput]"]=t(e.React)}("undefined"!=typeof self?self:this,(function(e){return function(){var t={5329:function(t){"use strict";t.exports=e},448:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const r=[];return e&&r.push(`${s}${e}`),t.forEach((e=>{e&&(r.push(`${s}${e}`),r.push(e))})),r.join(" ")};const u=13,c=27;function d(e){return t=>{t.keyCode===e&&(t.preventDefault(),t.stopPropagation(),t.currentTarget.click())}}d(32),d(u),d(c);var p={root:"text-box",label:"text-box__label",input:"text-box__input"};const f=({size:e,...t})=>r.createElement("svg",{viewBox:"0 0 20 20",fill:"currentColor",width:e||"20",height:e||"20",...t},r.createElement("path",{fillRule:"evenodd",d:"M9.5,3 C13.084,3 16,5.916 16,9.5 C16,13.084 13.084,16 9.5,16 C5.916,16 3,13.084 3,9.5 C3,5.916 5.916,3 9.5,3 Z M9.5,4 C6.467,4 4,6.467 4,9.5 C4,12.533 6.467,15 9.5,15 C12.533,15 15,12.533 15,9.5 C15,6.467 12.533,4 9.5,4 Z M10,11 L10,12 L9,12 L9,11 L10,11 Z M10,7 L10,10 L9,10 L9,7 L10,7 Z"}));f.displayName="ErrorSmall";var b=f,v="TLWrjM",y="GIPQqH",m="JNgJbf";const x=e=>{let{errorMessage:t,errorMessageType:n,shouldShowValidityIndication:a,translations:o,dataHook:i,componentViewMode:s}=e;const l="editor"===s?(null==o?void 0:o.errorMessage)||"Error text displays here.":t;return"inline"===n&&a&&l?r.createElement("div",{"data-hook":i||"inline-error-message",className:v},r.createElement(b,{className:y}),r.createElement("span",{className:m},l)):null};var h={TextAreaDefaultSkin:"snt4Te",textAreaDefaultSkin:"snt4Te",textarea:"rEindN","validation-indication":"pOExcs",validationIndication:"pOExcs",label:"PSkPrR",hasLabel:"oKe0Po","required-indication":"NyPO4H",requiredIndication:"NyPO4H",ResponsiveTextAreaDefaultSkin:"lk9PkF",responsiveTextAreaDefaultSkin:"lk9PkF",keepInputHeight:"q2xQkn"};const g=()=>{},k=(e,n)=>{var a;const{skin:o,id:s,className:u,customClassNames:c=[],value:d="",label:f,placeholder:b,readOnly:v,required:y,isDisabled:m,maxLength:k,isResponsive:w,shouldShowValidityIndication:M,isValid:E,errorMessageType:C="tooltip",validateValue:I=g,onValueChange:S=g,setValidityIndication:T=g,onBlur:P=g,onFocus:_=g,onKeyPress:L=g,onInput:O=g,onChange:V=g,onClick:j=g,onDblClick:A=g,onMouseEnter:N=g,onMouseLeave:R=g,ariaAttributes:D,componentViewMode:q,translations:H,keepInputHeightEnabled:F}=e,[B,Z]=r.useState(),$=r.useRef(null);r.useImperativeHandle(n,(()=>({focus:()=>{var e;null==(e=$.current)||e.focus()},blur:()=>{var e;null==(e=$.current)||e.blur()},setCustomValidity:e=>{var t;"message"===e.type&&(null==(t=$.current)||t.setCustomValidity(e.message))}})));const K=e=>{Z(!0),S(e),I(),T(!1)};r.useEffect((()=>{setTimeout((()=>{K(d)}),0)}),[]);const J=!!f,Q=i(h[o],u,l(p.root,...c),{[h.hasLabel]:J,[h.requiredIndication]:y,[h.validationIndication]:!!M},F?h.keepInputHeight:null);return r.createElement("div",t()({id:s},(e=>Object.entries(e).reduce(((e,[t,r])=>(t.includes("data-")&&(e[t]=r),e)),{}))(e),!F&&{className:Q},{onClick:e=>{m||j(e)},onDoubleClick:e=>{m||A(e)},onMouseEnter:e=>{m||N(e)},onMouseLeave:e=>{m||R(e)}}),r.createElement(...F?["div",{className:Q,"data-testid":"textbox-wrapper-inside-experiment"}]:[r.Fragment,{}],r.createElement(r.Fragment,null,r.createElement("label",{htmlFor:"textarea_"+s,className:i(h.label,l(p.label))},f),r.createElement("textarea",t()({ref:$,id:"textarea_"+s,className:i(h.textarea,"has-custom-focus",l(p.input)),rows:w?1:void 0,value:d,onFocus:_,onKeyDown:L,onChange:e=>{K(e.currentTarget.value),e.type="input",O(e)},onBlur:e=>{T(!0),P(e),B&&V({...e,type:"change"}),Z(!1)},placeholder:b,readOnly:v,required:y,"aria-required":y,"aria-invalid":M?!E:void 0,maxLength:null===k?void 0:k,disabled:m},(({pressed:e,expanded:t,haspopup:r,label:n,live:a,relevant:o,current:i,owns:s,controls:l,roleDescription:u,hidden:c,disabled:d,describedBy:p,labelledBy:f,errorMessage:b,atomic:v,role:y,busy:m,...x}={})=>{const h=x.tabIndex??x.tabindex,g={};return n&&(g["aria-label"]=n),a&&(g["aria-live"]=a),i&&(g["aria-current"]=i),e&&(g["aria-pressed"]=e),"boolean"==typeof c&&(g["aria-hidden"]=c),"boolean"==typeof t&&(g["aria-expanded"]=t),"boolean"==typeof d&&(g["aria-disabled"]=d),"boolean"==typeof v&&(g["aria-atomic"]=v),"boolean"==typeof m&&(g["aria-busy"]=m),"string"==typeof o&&(g["aria-relevant"]=o),"string"==typeof s&&(g["aria-owns"]=s),"string"==typeof l&&(g["aria-controls"]=l),"string"==typeof u&&(g["aria-roledescription"]=u),r&&(g["aria-haspopup"]=r),"number"==typeof h&&(g.tabIndex=h),y&&(g.role=y),p&&(g["aria-describedby"]=p),f&&(g["aria-labelledby"]=f),b&&(g["aria-errormessage"]=b),g})(D))))),r.createElement(x,{errorMessageType:C,errorMessage:null==(a=$.current)?void 0:a.validationMessage,shouldShowValidityIndication:M,translations:H,componentViewMode:q}))};var w=r.forwardRef(k);const M=(e,n)=>r.createElement(w,t()({isResponsive:!1,ref:n},e));const E=(e,n)=>r.createElement(w,t()({isResponsive:!0,ref:n},e));const C={TextAreaDefaultSkin:r.forwardRef(M),ResponsiveTextAreaDefaultSkin:r.forwardRef(E)},I=(e,n)=>{const{skin:a}=e,o=C[a];return r.createElement(o,t()({ref:n},e))};const S=e=>e.replace(/([A-Z])/g,(e=>`-${e.toLowerCase()}`));var T;const P={TextAreaInput:{component:r.forwardRef(I),controller:(T=e=>{let{mapperProps:t,controllerUtils:r}=e;return{...t,...(n=r.updateProps,{onValueChange:e=>{n({value:e})},setValidityIndication:e=>{n({shouldShowValidityIndication:e})}})};var n},{useComponentProps:(e,t,r)=>{const n=(e=>({...e,updateStyles:t=>{const r=Object.entries(t).reduce(((e,[t,r])=>{return{...e,[(n=t,n.startsWith("--")?t:S(t))]:void 0===r?null:r};var n}),{});e.updateStyles(r)}}))(r);return T({mapperProps:e,stateValues:t,controllerUtils:n})}})}}}(),a}()})); //# sourceMappingURL=https://static.parastorage.com/services/editor-elements-library/dist/thunderbolt/rb_wixui.thunderbolt[TextAreaInput].c7f29af1.bundle.min.js.map